package com.sinosoft.ebusiness.consume;

import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;
import java.text.SimpleDateFormat;

@Service("nspInterLogListenter")
public class NspInterLogListenter implements MessageListener {

    final static SimpleDateFormat sdFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");


    @Override
    public void onMessage(Message message) {
        String content ="";
        String[] strArr;
        if(message instanceof TextMessage){
            try {
                content = ((TextMessage) message).getText();
                System.err.println(content);
            } catch (JMSException e) {
                e.printStackTrace();
            }
        }
    }
}
